﻿using Socium.Domain.Persons;
using Socium.Domain.Tests;
using Socium.Domain.Tests.Testings;

namespace Socium.Testings {
	class SingleVariantTreeItem : VariantTreeItemBase {
		public SingleVariantTreeItem(Variant model) : base(model.Text) {
			_variant = model;
		}

		readonly Variant _variant;

		public override void Save(Person person, Testing testing) {
			testing.AddAnswer(new ClosedAnswer(person, _variant));
		}

		public override void Load(Person person, Testing testing) {
			// Do nothing
		}

		public bool IsMatch(Variant variant) {
			return variant == _variant;
		}
	}
}
